import React from 'react'
import { useSelector, useDispatch } from 'react-redux';
import { stateType } from '../types/index';
import { useState } from 'react'
type Props = {}

export default function Category({ }: Props) {
    const state = useSelector((state: stateType) => state)
    const dispatch = useDispatch();

    // 定义数据
    const [num, setnum] = useState(100);
    const [age, setage] = useState(20);

    const vnode = (
        <div>
            <p>我是分类页</p>
            {/* <p onClick={() => {
                dispatch({ type: '+' })
            }}>count:{state.count}</p> */}

            {/* 自己当前组件的数据 */}
            <p onClick={() => {
                setnum(num + 1)
            }}>{num}</p>
            <p>{age}</p>
        </div>
    )

    console.log('vnode', vnode)

    return vnode


}